<?php
	session_start();
	include("../Data/User.php");
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Quản Lý</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="../js/myScript.js"></script>
<script type="text/javascript" language="javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" language="javascript" src="../js/jquery.cycle.all.js"></script>
<link rel="stylesheet" type="text/css" href="css/css.css">
</head>

<body>
	<div align="right">
		<?php
			if(isset($_SESSION["user"]) == false)
			{
				echo '<script type = "text/javascript">';
				echo 'location = "../index.php";';
				echo '</script>';
			}else{
				$user = unserialize($_SESSION['user']);
				$role=$user->getRole();
				switch($role)
				{
					case 'Admin':
						?>
						<a href="../index.php">Trở về trang chủ</a> &nbsp;|&nbsp;
						<?php
						echo "Xin chào ".$user->getTenDangNhap();
						?>
							&nbsp;|&nbsp;
						<input type="button" value="Đăng xuất" onclick="ChuyenTrangDangXuatQuanLy()" />
						<?php
						include("page/pAdmin.php");
						break;
					
					case 'Seller':
						?>
						<a href="../index.php">Trở về trang chủ</a> &nbsp;|&nbsp;
						<?php
						echo "Xin chào ".$user->getTenDangNhap();
						?>
							&nbsp;|&nbsp;
					<input type="button" value="Đăng xuất" onclick="ChuyenTrangDangXuatQuanLy()" />
						<?php
						include("page/pSeller.php");
						break;
					default:
						echo '<script type = "text/javascript">';
						echo 'location = "../index.php";';
						echo '</script>';
					break;
					}					
			}
		?>
</body>
</html>
